//
//  GuideScreen.cpp
//  match2
//
//  Created by Tri Vo on 7/15/13.
//
//

#include "GuideScreen.h"

using namespace cocos2d;
using namespace extension;

CCScene* GuideScreen::scene() {
    CCScene *scene = CCScene::create();
    
    GuideScreen *gs = GuideScreen::create();
    scene->addChild(gs);
    return scene;
}

bool GuideScreen::init() {
    if(!CCLayer::init()) {
        return false;
    }
    
    CCSize winSize = GameController::getWinSize();
    char* pTitleFont = GameController::getFontNameForTitle();
    char* pMenuFont = GameController::getFontNameForMenu();
    int titleFontSize = GameController::getFontSizeForTitle();
    int menuFontSize = GameController::getFontSizeForMenu();
    CCLabelTTF *lblTitle = CCLabelTTF::create("Guide", pTitleFont, titleFontSize);
    lblTitle->setPosition(ccp(winSize.width/2, winSize.height/2 + 120));
    this->addChild(lblTitle, 1);
    
    
    // Menu
    CCMenuItem *btnBack = CCMenuItemFont::create("Back", this, menu_selector(GuideScreen::backToMenuScreen));
    
    CCMenu *pMenu = CCMenu::create(btnBack, NULL);
    pMenu->setPosition(ccp(40, winSize.height/2 - 120));
    addChild(pMenu);
    
    return true;
}

#pragma mark - Actions

void GuideScreen::backToMenuScreen(CCObject *pSender) {
    GameController::popScene(MenuScreen::scene());
}